-
Notifications
You must be signed in to change notification settings - Fork 42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pipes - Bennett - Muncher #41
base: master
Are you sure you want to change the base?
Conversation
…h indexes and show
… and some styling.
API MuncherWhat We're Looking For
|
url = BASE_URL + "q=" + query + ID_AND_KEY + paginate(from) | ||
data = HTTParty.get(url) | ||
unless data["hits"].empty? | ||
data["hits"].each do |hit_data| |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You shouldn't need the unless
statement here - if data["hits"]
is empty, then data["hits"].each
will iterate zero times.
must_redirect_to root_path | ||
flash[:message].must_equal "Invalid input: please try again without symobls." | ||
end | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know pagination isn't working, but there are a few test cases around it that I would like to see here:
- Make sure paging parameters are accepted, and that requesting a different page doesn't break things
- What if the paging parameters are invalid (negative number, etc)?
- What if the paging parameters take you past the end of the available search results?
API Muncher
Congratulations! You're submitting your assignment!
Comprehension Questions
This does not represent a necessarily finished project, I didn't finish the pagination or various other things, but its good enough and I'm done. For now.